package com.csdj.t309.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ProxyTestHandler implements InvocationHandler {

    private Object proxyTest;
    public ProxyTestHandler(Object proxyTest){
        this.proxyTest = proxyTest;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("动态代理生效");
        return method.invoke(this.proxyTest,args);//对实际对象进行访问
    }
}
